import java.util.*;
public class List {

	/**
	 * @param args
	 */
	static ArrayList<String> names= new ArrayList<String>();
	public static void main(String[] args) {
		names.add("Nick");
		names.add("John");
		names.add("Bacon");
		names.add("Lucy");
		names.add("Ralph");
		names.add("Sam");
		names.add("Liam");
		names.add("Daniel");
		Scanner input=new Scanner(System.in);
		System.out.println("What name would you like to check for?");
		String name=input.next();
		run(name);
	}
	static void run(String name){
		Scanner input=new Scanner(System.in);
		boolean on=false;
		for (int i=0;i<names.size();i++){
			if (name.equalsIgnoreCase(names.get(i))){
				System.out.println("Your name is on the list.");
				on=true;
				break;
			}
		}
			if(on==false){
				System.out.println("Your name is not on the list, would you like to put it on the list?");
				String ans=input.next();
				if(ans.equalsIgnoreCase("yes")){
					names.add(name);
					System.out.println("The name "+ans+" has been added.");
				}
				else{
					System.out.println("Fine the name will not be added.");
				}
			}
		System.out.println("Would you like to check another name?");
		String ans=input.next();
		if (ans.equalsIgnoreCase("Yes")){
			input();
		}
		else{
			System.out.println("Good day then.");
		}

	}
	static void input(){
		Scanner input=new Scanner(System.in);
		System.out.println("What name would you like to check for?");
		String name=input.next();
		run (name);
		
	}

}
